package com.rockcent.mall.lib.dto;

import com.rockcent.common.domain.DtoEntity;
import com.rockcent.common.domain.IDEntityMall;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * Created by oyhk on 16/7/15.
 */
public class CategoryDto extends DtoEntity {

    //名称
    @Length(min = 1, max = 50, message = "名称不能超过字数")
    private String name;
    //图标Url
    @NotEmpty(message = "请选择图标")
    @Length(min = 1, max = 1000, message = "图标路径不能超过字符数")
    private String iconUrl;
    //是否可见
    private Boolean visible = true;
    //显示顺序
    @NotNull(message = "请填写显示顺序")
    private Integer displayOrderId;
    //描述
    private String note;
    //平台id
    private Long mallId;
    //父品类
    private Long parentId;

    //是否存在二级目录
    private boolean hasTowLevel=false;
    //是否存在三级目录
    private boolean hasThreeLevel=false;
    /**
     * 子类目列表
     */
    private List subList;

    public boolean isHasTowLevel() {
        return hasTowLevel;
    }

    public void setHasTowLevel(boolean hasTowLevel) {
        this.hasTowLevel = hasTowLevel;
    }

    public boolean isHasThreeLevel() {
        return hasThreeLevel;
    }

    public void setHasThreeLevel(boolean hasThreeLevel) {
        this.hasThreeLevel = hasThreeLevel;
    }

    /**
     * 层级
     */
    private Long leave;

    // 类目图片id
    @NotNull(message = "请上次类目图片")
    private Long imgId;
    // 上传图片的picToken
    @NotEmpty(message = "picToken 不能为空")
    private String picToken;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIconUrl() {
        return iconUrl;
    }

    public void setIconUrl(String iconUrl) {
        this.iconUrl = iconUrl;
    }

    public Boolean getVisible() {
        return visible;
    }

    public void setVisible(Boolean visible) {
        this.visible = visible;
    }

    public Integer getDisplayOrderId() {
        return displayOrderId;
    }

    public void setDisplayOrderId(Integer displayOrderId) {
        this.displayOrderId = displayOrderId;
    }

    public String getNote() {
        return note;
    }

    public List getSubList() {
        return subList;
    }

    public void setSubList(List subList) {
        this.subList = subList;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Long getImgId() {
        return imgId;
    }

    public Long getLeave() {
        return leave;
    }

    public void setLeave(Long leave) {
        this.leave = leave;
    }

    public void setImgId(Long imgId) {
        this.imgId = imgId;
    }

    public String getPicToken() {
        return picToken;
    }

    public void setPicToken(String picToken) {
        this.picToken = picToken;
    }

    @Override
    public String toString() {
        return "CategoryDto{" +
                "name='" + name + '\'' +
                ", iconUrl='" + iconUrl + '\'' +
                ", visible=" + visible +
                ", displayOrderId=" + displayOrderId +
                ", note='" + note + '\'' +
                ", mallId=" + mallId +
                ", parentId=" + parentId +
                ", hasTowLevel=" + hasTowLevel +
                ", hasThreeLevel=" + hasThreeLevel +
                ", subList=" + subList +
                ", leave=" + leave +
                ", imgId=" + imgId +
                ", picToken='" + picToken + '\'' +
                '}';
    }
}
